cmake_minimum_required(VERSION 3.10)

project(GitTest)
set(EXECUTABLE_NAME "calculator")

add_compile_options(-O2)

file(GLOB_RECURSE ALL_HDRS "include/*.h")
file(GLOB_RECURSE ALL_SRCS "src/*.cpp")

set(INCLUDE_DIR 
  include
)

# 添加头文件搜索路径
include_directories(
  ${INCLUDE_DIR} 
)

# 添加可执行文件
add_executable(${EXECUTABLE_NAME} ${ALL_SRCS})

set_target_properties(${EXECUTABLE_NAME}
  PROPERTIES
  ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib"
  LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib"
  RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin"
)